package org.qydjk.console.service;

import org.qydjk.common.pojo.Category;
import org.qydjk.common.service.IBaseService;
import org.qydjk.common.vo.EasyUIResponse;

import java.util.List;

/**
 * 分类service
 * Created by Edward_yang on 2017/12/13 0013.
 */
public interface ICategoryService extends IBaseService{
    /****
     * 返回EasyUIResponse的所有查询
     * 带分页
     * @author Edward_yang
     * @uptime 2017-12-13
     * @return EasyUIResponse
     */
    public EasyUIResponse findAllCategoryList(Integer page, Integer rows)throws Exception;

    /***
     * 查询所有返回 List
     * @author Edward_yang
     * @uptime 2017-12-13
     * @return List<Category>
     */
    public List<Category> findAllList() throws Exception;

    /**
     * 根据叶子节点的ids查找所有的包含自己的父节点的ids
     * @param leafIds
     * @return
     * @throws Exception
     */
    public String findAllByLeafIds(String leafIds) throws Exception;

    /**
     * 排除所有父节点的ids
     * @param callIds
     * @return
     * @throws Exception
     */
    public String findAllNoParentCatIds(String callIds) throws Exception;

    /**
     * 保存分类,更新父节点为非叶子节点
     */
    public void saveCategoryAndUpdateParentLeaf(Category category)throws Exception;

    /**
     * 编辑分类,判断是否需要更新父节点叶子状态
     */
    public void updateCategoryAndUpdateParentLeaf(Category category, Integer parentId) throws Exception;

    /**
     * 刪除分类时如果父节点不包含子节点,修改父节点为叶子节点
     *
     * @param category
     */
    public void deleteCategoryAndUpdateParentLeaf(Category category) throws Exception;
}
